import Taro, { Component } from '@tarojs/taro'
import { View, Camera, Button, Image } from '@tarojs/components'
import './index.css'

export default class Index extends Component {

  config = {
    navigationBarTitleText: '首页'
  } 

  constructor () {
    super(...arguments)
    // this.state = {
    //   src: ''
    // }
  }

  // takePhoto() {
  //   let me = this;
  //   const ctx = Taro.createCameraContext()
  //   ctx.takePhoto({
  //     quality: 'high',
  //     success: (res) => {
  //       me.setState({
  //         src: res.tempImagePath
  //       });
  //     }
  //   })
  // }

  componentWillMount () { }

  componentDidMount () { }

  componentWillUnmount () { }

  componentDidShow () { }

  componentDidHide () { }

  render () {
    return (
      <View className='index'>
        {/* <Camera devicePosition='front' flash='on'></Camera>
        <Button onClick={this.takePhoto}>拍照</Button>
        <View>预览</View>
        <Image src={src}></Image> */}
      </View>
    )
  }
}
